﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Security.Policy;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BaseFeatureDemo.Base.File
{
    [TestClass]
    public class FileDemo2
    {
        public static void Main1()
        {
            var runPath = Environment.CurrentDirectory;
            const string ProjectName = "HelloCSharp";
            var index = runPath.IndexOf(ProjectName, System.StringComparison.Ordinal);
            var path = runPath.Substring(0, index + ProjectName.Length) + "\\";
        }

        private static int fib(int n)
        {
           
        }

        [TestMethod]
        public void test2()
        {
            var path = System.IO.Path.GetFullPath(
                System.IO.Directory.GetCurrentDirectory() + "../../../../dbFile/temp.zip");

            var str =
                "H4sIAAAAAAACA1WPT0+DQBDF7/spRgTttbRsZRPZ1d1Fwg0OBYKEhWqMlwZBqjaF\nz+7Win8ylzeT95u8F8Otj4UkjIrCcxCKYzCmA0KqAMvFYFMRYA6SwTVZ4RykvvmU\n3GEu9GZTB7DWoXQJvdqi6gRJTKULPVkwai+XBKjvLTDforqAeTsObWMlnS1x0XPm\n7XEYMO4k0a6fgcBU6N/g2GGUFj3jni2T6HDouiiH6N0c758eSxWlOXzxAwt+TF3n\nedr0z5bOdSv4YITChYkMA3ac+TfPKDuJ71xABGTZlKuuFIxq87CBF1XqUapMs0wj\nl5iTVQhtc2a1b80Rmrqs9+scmsGcvZ4nhkp/dfVH18c0n2XEkwVzAQAA"
                ;

            var bpath = Convert.FromBase64String(str);

            System.IO.File.WriteAllBytes(path, bpath);
        }
    }
}